import { createSlice } from "@reduxjs/toolkit";
import { MenuState } from "../interface";

const menuState: MenuState = {
	isCollapse: false,
	menuList: []
};

const menuSlice = createSlice({
	name: "menu",
	initialState: menuState,
	reducers: {
		updateCollapse(state, actions) {
			state.isCollapse = actions.payload;
		},
		setMenuList(state, actions) {
			state.menuList = actions.payload;
		}
	}
});


export const { updateCollapse, setMenuList } = menuSlice.actions;
export default menuSlice.reducer;
